﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Eassets.Data.Asset;
using Eassets.Layered.Domain.Asset;


namespace Eassets.Service.Asset
{
    public class AssetService
    {
        AssetData assetdata = new AssetData();

        /// <summary>
        /// Inserts asset.
        /// </summary>
        /// <param name="asset"></param>
        public void AddAsset(Assets asset)
        {
            if (asset != null)
            {
                assetdata.AddAsset(asset);
            }
        }

        /// <summary>
        /// Updates asset.
        /// </summary>
        /// <param name="asset"></param>
        public void ModifyAsset(Assets asset)
        {
            if (asset != null)
            {
                assetdata.ModifyAsset(asset);
            }
        }

        /// <summary>
        /// Delete asset.
        /// </summary>
        /// <param name="assetId"></param>
        public void DeleteAsset(long assetId)
        {
            if (assetId != 0)
            {
                assetdata.DeleteAsset(assetId);
            }
        }

        /// <summary>
        /// GetbyId asset.
        /// </summary>
        /// <param name="assetId"></param>
        /// <returns></returns>
        public Assets GetByIdAsset(long assetId)
        {
            return assetdata.GetByIdAsset(assetId);
        }

        /// <summary>
        /// GetAll asset.
        /// </summary>
        /// <returns></returns>
        public Collection<Assets> GetAllAsset()
        {
            return assetdata.GetAllAsset();
        }

        public List<Assets> GetAllAssetsNotInCompanyAssets()
        {
            return assetdata.GetAllAssetsNotInCompanyAssets();
        }
    }
}
